/**
 * Created by devin on 3/17/17.
 */

(function () {
    'use strict';

    angular.module('youzhu').factory('LoginService', LoginService);

    LoginService.$inject = ['$resource'];
    function LoginService($resource) {
        var resourceUrl = 'person/login';
        var service = $resource(resourceUrl, {}, {
            'query': {method: 'GET'},
            'get': {
                method: 'GET',
                transformResponse: function (data) {
                    data = angular.fromJson(data);
                    return data;
                }
            },
            'post': {method: 'POST'},
            'update': {method: 'PUT'},
            'delete': {method: 'DELETE'}
        });
        return service;
    }
})();
